import { useEffect, useState, useRef } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import { Field, BInput } from "mooli-mobile";
import { Icon } from "mooli-mobile";
import { Grid } from '@fexd/mobile'
import { Alert } from '@fexd/mobile'
import { ProgressBar } from '@fexd/mobile'
import { toast } from '@fexd/mobile'
import { Button } from '@fexd/mobile'
import { Avatar, Badge, DemoBlock } from '@fexd/mobile'
import { cloneFC, TransitionSlideUp, loading } from "@fexd/mobile"
import { Image } from '@arco-design/mobile-react';
import { useSize } from 'ahooks';
import { useNetwork } from 'ahooks';

import "./App.css";

function App() {
  const [count, setCount] = useState(0);
  const networkState = useNetwork();
  console.log(useSize)
  console.log(networkState)
  useEffect(()=> {
    toast.info("sasdasdasd")
    loading.show({
      mask: false,
    })
  },[]);
  return (
    <>
      <div>
        <a href="https://vitejs.dev" target="_blank">
          <img src={viteLogo} className="logo" alt="Vite logo" />
        </a>
        <a href="https://react.dev" target="_blank">
          <img src={reactLogo} className="logo react" alt="React logo" />
        </a>
      </div>
      <Image
          width="2.18rem"
          height="2.18rem"
          staticLabel
          retryTime={3}
          src="//sf1-cdn-tos.toutiaostatic.com/obj/arco-mobile/_static_/large_image_1.jpg"
          nativeProps={{
              crossOrigin: 'anonymous'
          }}
        />
      <TransitionSlideUp>43545</TransitionSlideUp>
      <DemoBlock inline title="业务组件">
        <Badge content="5">
          <div className="demo-badge-box" />
        </Badge>
        <Badge.Stamp text="戳">
          <div className="demo-badge-box" />
        </Badge.Stamp>
      </DemoBlock>
      <Avatar.Group max={3}>
        <Avatar>I</Avatar>
        <Avatar>J</Avatar>
        <Avatar>K</Avatar>
        <Avatar>L</Avatar>
        <Avatar>M</Avatar>
      </Avatar.Group>
      <Grid>
        <Grid.Item>自定义内容</Grid.Item>
      </Grid>
      <Alert>This is an alert!</Alert>
      <ProgressBar value={50}/>
      <Field />
      <BInput border clearable label="文本" className="demo-name" />
      <Icon />
      <h1>Vite + React</h1>
      <div className="card">
        <Button type="primary" onClick={() => setCount((count) => count + 1)}>
          count is {count}
        </Button>
        <p>
          Edit <code>src/App.tsx</code> and save to test HMR
        </p>
      </div>
      <p className="read-the-docs">
        ss Click on the Vite and React logos to learn more
      </p>
    </>
  );
}

export default App;
